package org.znxs.comfriend.activities;

import android.content.Intent;
import android.os.Bundle;
import android.widget.ImageView;

import androidx.appcompat.app.AppCompatActivity;

import com.bumptech.glide.Glide;

import org.znxs.comfriend.R;

public class ImageDetailActivity extends AppCompatActivity {
    private ImageView ivImageDetail;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_image_detail);

        // 初始化视图
        ivImageDetail = findViewById(R.id.iv_fullscreen_image);

        // 获取传递的图片 URL
        Intent intent = getIntent();
        if (intent != null && intent.hasExtra("image_url")) {
            String imageUrl = intent.getStringExtra("image_url");
            Glide.with(this)
                    .load(imageUrl)
                    .placeholder(R.drawable.pengyiyan)
                    .error(R.drawable.error)
                    .into(ivImageDetail);
        }
    }
}